#include <stdio.h>
#include <dlfcn.h>

int main()
{
void *dp = dlopen("libm.so.6",RTLD_LAZY);

double (*sin)(double) = (double (*)(double))dlsym(dp,"sin");

printf("sin:%e\n",sin(90));

void* handle = dlopen("libi_math.so",RTLD_LAZY);  

if(handle == NULL)
{
 fputs(dlerror(),stderr);     
}

int (*min)(int,int) = (int (*)(int,int))dlsym(handle, "min");

if(min == NULL)
fputs(dlerror(),stderr);
else
printf("min:%d\n",min(5,6));

dlclose(handle);

dlclose(dp);

return 0;
}
